function gridInit(gridData){

    var grid = gridData.grid;

    grid.jqGrid({
        //表名
        caption: '',
        //底部导航栏
        pager: gridData.pager,
        viewrecords: true,	//显示总记录数
        rowList: gridData.rowList,
        scroll: gridData.scroll,
        //样式
        styleUI: "Bootstrap",
        height: gridData.height,
        autowidth: true,
        //显示行号
        rownumbers: gridData.rownumbers,
        //提交头部信息
        beforeRequest: function () {
            gridData.beforeRequest();
        },
        //读取信息
        url: gridData.url,
        mtype: "post",
        datatype: gridData.datatype,
        colModel: gridData.colModel,
        rowNum: gridData.rowNum,
        sortname: gridData.sortname,
        jsonReader: gridData.jsonReader,
        //完成加载
        loadComplete: function(xhr){
            gridData.loadComplete(xhr);
        },
        //选择行
        onSelectRow: function(rowid,status){
            gridData.onSelectRow(rowid,status);
        },
        //双击
        ondblClickRow: function(rowid,iRow,iCol,e){
            gridData.ondblClickRow(rowid,iRow,iCol,e);
        },
        //复选框
        multiselect: gridData.multiselect,
        onSelectAll: function(rowids,statue){
            gridData.onSelectAll(rowids,statue);
        },
        //单元格编辑
        cellEdit: gridData.cellEdit,
		cellsubmit: gridData.cellsubmit
    });
    
};


/****************************** 初始化jqGrid ******************************/
    var gridSearch = '';
    var gridWidth = $(document);
    var gridData = {
        grid: $("#jgTable"),
        pager: $("#jgPager"),
        url: "",
        datatype: "json",
        colModel: [],
        rowNum: 10,
        sortname: "",
        jsonReader: {
            root: "Content.rows",   //数据入口
            total: "Content.total",
            records: "Content.records"
        },
        rowList: [10,20,50,100],
        scroll: false,
        height: '100%',
        rownumbers: true,
        beforeRequest: function(){
            this.grid.jqGrid("setGridParam", {
                postData : postData,
            }); 
        },
        loadComplete: function(xhr){
            gridSize();
        },
        onSelectRow: function(rowid,status){},
        ondblClickRow: function(rowid,iRow,iCol,e){},
        multiselect: false,
        onSelectAll: function(rowids,status){},
        cellEdit: false,
        cellsubmit: 'clientArray'
    };
    function gridSize(){
        gridData.grid.setGridWidth(gridWidth.width());
    };
    window.onresize = function(){ gridSize(); };

    function search(){
        console.log(gridSearch)
        gridData.grid.jqGrid("setGridParam",{postData: gridSearch}).trigger("reloadGrid");
    }

// 